
/**
 * arcGisApi 实例集合
 * 目前只引入了部分api 子类  基于 arcgis api js  v4.15
 * 开发过程中若要引入其他类，可参考下方引入方式
 * xuqaing 20200724
 */
let arcGisApiInstance = {};
import {loadModules} from 'esri-loader'
import arcGisMapConfig from '../config/arcGisMapConfig'
const options = {
    url:arcGisMapConfig.dojoUrl,
};
loadModules([
    'esri/Basemap',
    'esri/Camera',
    'esri/Color',
    'esri/config',
    'esri/geometry',
    'esri/Graphic',
    'esri/Ground',
    'esri/intl',
    'esri/kernel',
    'esri/Map',
    'esri/pointCloudRenderers',
    'esri/PopupTemplate',
    'esri/rasterRenderers',
    'esri/renderers',
    'esri/request',
    'esri/symbols',
    'esri/TimeExtent',
    'esri/TimeInterval',
    'esri/Viewpoint',
    'esri/WebMap',
    'esri/WebScene',

    'esri/core/Accessor',
    'esri/core/Collection',
    'esri/core/Error',
    'esri/core/HandleOwner',
    'esri/core/Handles',
    'esri/core/lang',
    'esri/core/promiseUtils',
    'esri/core/scheduling',
    'esri/core/sql',
    'esri/core/urlUtils',
    'esri/core/watchUtils',
    'esri/core/workers',
    'esri/core/accessorSupport/decorators',
    'esri/core/workers/Connection',

    'esri/geometry/Circle',
    'esri/geometry/coordinateFormatter',
    'esri/geometry/Extent',
    'esri/geometry/Geometry',
    'esri/geometry/geometryEngine',
    'esri/geometry/geometryEngineAsync',
    'esri/geometry/HeightModelInfo',
    'esri/geometry/Mesh',
    'esri/geometry/Multipoint',
    'esri/geometry/Point',
    'esri/geometry/Polygon',
    'esri/geometry/Polyline',
    'esri/geometry/projection',
    'esri/geometry/SpatialReference',

    'esri/geometry/support/geodesicUtils',
    'esri/geometry/support/GeographicTransformation',
    'esri/geometry/support/GeographicTransformationStep',
    'esri/geometry/support/jsonUtils',
    'esri/geometry/support/MeshComponent',
    'esri/geometry/support/MeshMaterial',
    'esri/geometry/support/MeshMaterialMetallicRoughness',
    'esri/geometry/support/MeshTexture',
    'esri/geometry/support/meshUtils',
    'esri/geometry/support/normalizeUtils',
    'esri/geometry/support/webMercatorUtils',

    'esri/views/MapView', // 2D 视图实例
    'esri/views/draw/Draw',

    'esri/layers/GraphicsLayer', // 图形图层
    'esri/layers/support/TileInfo',
    'esri/layers/WebTileLayer',
    'esri/layers/TileLayer',
    'esri/layers/VectorTileLayer',
    "esri/layers/FeatureLayer",

    'esri/symbols/SimpleMarkerSymbol',
    'esri/symbols/TextSymbol',
    'esri/symbols/PictureMarkerSymbol',
    'esri/symbols/SimpleLineSymbol',
    'esri/symbols/SimpleFillSymbol',

    "esri/widgets/Sketch",

    "esri/renderers/HeatmapRenderer"
    ],options)
    .then(([
               Basemap,
               Camera,
               Color,
               esriConfig,
               geometry,
               Graphic,
               Ground,
               intl,
               kernel,
               Map,
               pointCloudRenderers,
               PopupTemplate,
               rasterRenderers,
               renderers,
               esriRequest,
               symbols,
               TimeExtent,
               TimeInterval,
               Viewpoint,
               WebMap,
               WebScene,
               Accessor,
               Collection,
               Error,
               HandleOwner,
               Handles,
               esriLang,
               promiseUtils,
               scheduling,
               sql,
               urlUtils,
               watchUtils,
               workers,
               decorators,
               Connection,
               Circle,
               coordinateFormatter,
               Extent,
               Geometry,
               geometryEngine,
               geometryEngineAsync,
               HeightModelInfo,
               Mesh,
               Multipoint,
               Point,
               Polygon,
               Polyline,
               projection,
               SpatialReference,
               geodesicUtils,
               GeographicTransformation,
               GeographicTransformationStep,
               geometryJsonUtils,
               MeshComponent,
               MeshMaterial,
               MeshMaterialMetallicRoughness,
               MeshTexture,
               meshUtils,
               normalizeUtils,
               webMercatorUtils,



        MapView,
               Draw,
        GraphicsLayer,
               TileInfo,
               WebTileLayer,
               TileLayer,
               VectorTileLayer,
               FeatureLayer,
               SimpleMarkerSymbol,
               TextSymbol,
               PictureMarkerSymbol,
               SimpleLineSymbol,
               SimpleFillSymbol,
               Sketch,
               HeatmapRenderer
        ]) => {
            arcGisApiInstance.Basemap = Basemap;
            arcGisApiInstance.Camera = Camera;
            arcGisApiInstance.Color = Color;
            arcGisApiInstance.esriConfig = esriConfig;
            arcGisApiInstance.geometry = geometry;
            arcGisApiInstance.Graphic = Graphic;
            arcGisApiInstance.Ground = Ground;
            arcGisApiInstance.intl = intl;
            arcGisApiInstance.kernel = kernel;
            arcGisApiInstance.Map = Map;
            arcGisApiInstance.pointCloudRenderers = pointCloudRenderers;
            arcGisApiInstance.PopupTemplate = PopupTemplate;
            arcGisApiInstance.rasterRenderers = rasterRenderers;
            arcGisApiInstance.renderers = renderers;
            arcGisApiInstance.esriRequest = esriRequest;
            arcGisApiInstance.symbols = symbols;
            arcGisApiInstance.TimeExtent = TimeExtent;
            arcGisApiInstance.TimeInterval = TimeInterval;
            arcGisApiInstance.Viewpoint = Viewpoint;
            arcGisApiInstance.WebMap = WebMap;
            arcGisApiInstance.WebScene = WebScene;
            arcGisApiInstance.Accessor = Accessor;
            arcGisApiInstance.Collection = Collection;
            arcGisApiInstance.Error = Error;
            arcGisApiInstance.HandleOwner = HandleOwner;
            arcGisApiInstance.Handles = Handles;
            arcGisApiInstance.esriLang = esriLang;
            arcGisApiInstance.promiseUtils = promiseUtils;
            arcGisApiInstance.scheduling = scheduling;
            arcGisApiInstance.sql = sql;
            arcGisApiInstance.urlUtils = urlUtils;
            arcGisApiInstance.watchUtils = watchUtils;
            arcGisApiInstance.workers = workers;
            arcGisApiInstance.decorators = decorators;
            arcGisApiInstance.Connection = Connection;
            arcGisApiInstance.Circle = Circle;
            arcGisApiInstance.coordinateFormatter = coordinateFormatter;
            arcGisApiInstance.Extent = Extent;
            arcGisApiInstance.Geometry = Geometry;
            arcGisApiInstance.geometryEngine = geometryEngine;
            arcGisApiInstance.geometryEngineAsync = geometryEngineAsync;
            arcGisApiInstance.HeightModelInfo = HeightModelInfo;
            arcGisApiInstance.Mesh = Mesh;
            arcGisApiInstance.Multipoint = Multipoint;
            arcGisApiInstance.Point = Point;
            arcGisApiInstance.Polygon = Polygon;
            arcGisApiInstance.Polyline = Polyline;
            arcGisApiInstance.projection = projection;
            arcGisApiInstance.SpatialReference = SpatialReference;
            arcGisApiInstance.geodesicUtils = geodesicUtils;
            arcGisApiInstance.GeographicTransformation = GeographicTransformation;
            arcGisApiInstance.GeographicTransformationStep = GeographicTransformationStep;
            arcGisApiInstance.geometryJsonUtils = geometryJsonUtils;
            arcGisApiInstance.MeshComponent = MeshComponent;
            arcGisApiInstance.MeshMaterial = MeshMaterial;
            arcGisApiInstance.MeshMaterialMetallicRoughness = MeshMaterialMetallicRoughness;
            arcGisApiInstance.MeshTexture = MeshTexture;
            arcGisApiInstance.meshUtils = meshUtils;
            arcGisApiInstance.normalizeUtils = normalizeUtils;
            arcGisApiInstance.webMercatorUtils = webMercatorUtils;

            arcGisApiInstance.MapView = MapView;
            arcGisApiInstance.Draw = Draw;
            arcGisApiInstance.GraphicsLayer = GraphicsLayer;
            arcGisApiInstance.TileInfo = TileInfo;
            arcGisApiInstance.WebTileLayer = WebTileLayer;
            arcGisApiInstance.TileLayer = TileLayer;
            arcGisApiInstance.VectorTileLayer = VectorTileLayer;
            arcGisApiInstance.FeatureLayer = FeatureLayer;
            arcGisApiInstance.SimpleMarkerSymbol = SimpleMarkerSymbol;
            arcGisApiInstance.TextSymbol = TextSymbol;
            arcGisApiInstance.PictureMarkerSymbol = PictureMarkerSymbol;
            arcGisApiInstance.SimpleLineSymbol = SimpleLineSymbol;
            arcGisApiInstance.SimpleFillSymbol = SimpleFillSymbol;

            arcGisApiInstance.Sketch = Sketch;
            arcGisApiInstance.HeatmapRenderer = HeatmapRenderer;
        })
    .catch(err => {
        console.log(err)
    });
export default arcGisApiInstance